<template>
  <a-drawer width="576" :title="formTitle" :label-col="4" :wrapper-col="14" :visible="open" :body-style="{ height: 'calc(100vh - 100px)', overflow: 'auto' }" @close="cancel">
    <a-form-model ref="form" :model="form" :rules="rules" layout="vertical">
      <a-spin :spinning="spinning" :delay="delayTime" tip="Loading...">
        <a-row :gutter="32">
          <a-col :span="24">
            <a-form-model-item label="键" prop="key">
              <a-input v-model="form.key" placeholder="请输入键" :disabled="form.type === '0'" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24">
            <a-form-model-item label="字符串值(分隔符为 , )" prop="valueString">
              <a-textarea v-model="form.valueString" placeholder="请输入字符串值" :rows="4" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="32">
          <a-col :span="24">
            <a-form-model-item label="富文本值" prop="valueRich">
              <a-textarea v-model="form.valueRich" placeholder="请输入富文本值" :rows="4" />
            </a-form-model-item>
          </a-col>
        </a-row>
        <a-row :gutter="32">
          <a-col :span="24">
            <a-form-model-item label="说明" prop="explain">
              <a-input v-model="form.explain" placeholder="请输入说明" />
            </a-form-model-item>
          </a-col>
          <a-col :span="24" v-if="form.type !== '0'">
            <a-form-model-item label="状态" prop="status">
              <a-select
                placeholder="请选择状态"
                v-model="form.status"
                :getPopupContainer="
                  triggerNode => {
                    return triggerNode.parentNode || document.body
                  }
                "
                style="width: 100%"
                allow-clear
              >
                <a-select-option v-for="(d, index) in statusOptions" :key="index" :value="d.dictValue">{{ d.dictLabel }}</a-select-option>
              </a-select>
            </a-form-model-item>
          </a-col>
        </a-row>
      </a-spin>
      <div class="bottom-control">
        <a-space>
          <a-button :disabled="disabled" @click="cancel"> 取消 </a-button>
          <a-button type="primary" :disabled="disabled" @click="submitForm(true)"> 保存 </a-button>
        </a-space>
      </div>
    </a-form-model>
  </a-drawer>
</template>
<script>
import PlatformConfigEditForm from './PlatformConfigForm'
export default {
  ...PlatformConfigEditForm
}
</script>
